package com.shareach.dao.mongo;

import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.mongodb.core.mapreduce.GroupByResults;
import org.springframework.data.mongodb.core.mapreduce.MapReduceResults;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;

import com.shareach.common.BaseQueryOrder;
import com.shareach.domain.BizTicketDomain;

public interface BizTicketDao {

	public Long insert(BizTicketDomain domain);
	public void update(Criteria criteria, Update update);


	public void update(Query query, Update update);
	public List<BizTicketDomain> getLastNumberByCondition(LinkedHashMap<String, String> conditionArgs);

	public <T> MapReduceResults<T> groupMapReduce(Query query, String map, String reduce, Class<T> clas);

	public <T> GroupByResults<T> group(Criteria criteria, String key, String map, String reduce, Class<T> clas);

	public <T> GroupByResults<T> groups(Criteria criteria, String map, String reduce, Class<T> clas, String... key);

	public List<BizTicketDomain> findList(Criteria criteria);

	public List<BizTicketDomain> findList(Query query);

	public BizTicketDomain findOne(Query query);

	public <T> void delete(Query query, Class<T> clas);
	public Page<BizTicketDomain> getPageResult(Query query,BaseQueryOrder order);
	
}
